package cn.wolfcode.wolfcodemall.domain;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Getter
@Setter
public class Product {
    private Integer productId;

    private String productName;

    private String productTitle;

    private BigDecimal productPrice;

    private BigDecimal productSalePrice;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date productCreateDate;

    private Integer productCategoryId;

    private Integer productIsEnabled;

    //概述图片
    private List<ProductImage> productSinglePicList;
    //详情图片
    private List<ProductImage> productDetailsPicList;

    //拥有的属性信息
    private List<Property> propertyList;

    // 自定义
    private Category category;
    private Integer productSaleCount;

    public String getProductCreateDate(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return sdf.format(productCreateDate);
    }

}
